── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.3.0
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.1.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(sf)
Linking to GEOS 3.13.0, GDAL 3.8.5, PROJ 9.5.1; sf_use_s2() is TRUE
library(here)
here() starts at /Users/joaquinsandoval/Documents/MEDS/EDS-223/Homework/eds-223-homework1
library(tmap)
Import Data
# Read in geodatabase of EJScreen data at the Census Block Group levelejscreen <- sf::st_read(here::here("data", "ejscreen","EJSCREEN_2023_BG_StatePct_with_AS_CNMI_GU_VI.gdb"))
Reading layer `EJSCREEN_StatePctiles_with_AS_CNMI_GU_VI' from data source
`/Users/joaquinsandoval/Documents/MEDS/EDS-223/Homework/eds-223-homework1/data/ejscreen/EJSCREEN_2023_BG_StatePct_with_AS_CNMI_GU_VI.gdb'
using driver `OpenFileGDB'
Simple feature collection with 243021 features and 223 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -19951910 ymin: -1617130 xmax: 16259830 ymax: 11554350
Projected CRS: WGS 84 / Pseudo-Mercator
# Filter to state of Californiacalifornia <- ejscreen |> dplyr::filter(ST_ABBREV =="CA") # Filter to Ventura Countyventura <- ejscreen |> dplyr::filter(CNTY_NAME %in%c("Ventura County"))# Read in city boundary data with city names for Ventura Countycity_boundary <- sf::st_read(here::here("data", "City_Boundary", "City_Boundary.shp"))
Reading layer `City_Boundary' from data source
`/Users/joaquinsandoval/Documents/MEDS/EDS-223/Homework/eds-223-homework1/data/City_Boundary/City_Boundary.shp'
using driver `ESRI Shapefile'
Simple feature collection with 10 features and 11 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 6162344 ymin: 1867837 xmax: 6370545 ymax: 1996012
Projected CRS: NAD83 / California zone 5 (ftUS)
Visualize Data
tmap_mode("view")
ℹ tmap modes "plot" - "view"
ℹ toggle with `tmap::ttm()`
[v3->v4] `tm_layout()`: use `tm_title()` instead of `tm_layout(title = )`
[cols4all] color palettes: use palettes from the R package cols4all. Run
`cols4all::c4a_gui()` to explore them. The old palette name "YlOrBr" is named
"brewer.yl_or_br"
Multiple palettes called "yl_or_br" found: "brewer.yl_or_br", "tol.yl_or_br", "matplotlib.yl_or_br". The first one, "brewer.yl_or_br", is returned.